import Router from 'koa-router';
import bodyParser from 'koa-bodyparser';
import { findAllcontroller, regRoute } from './until.js';
import cors from '@koa/cors'

const router = new Router()

export const useController=function(app){

    app.use(cors());
    app.use(bodyParser());

    let controllers=findAllcontroller();

    regRoute(router,controllers);

    app.use(router.routes());
}

